home *** CD-ROM | disk | FTP | other *** search
- Path: druid.borland.com!usenet
- From: pete@borland.com (Pete Becker)
- Newsgroups: comp.lang.c
- Subject: Re: f;oating point precision
- Date: 6 Mar 1996 16:12:21 GMT
- Organization: Borland International
- Message-ID: <4hkdh5$md1@druid.borland.com>
- References: <c0d_9603050128@csource.blaze.net.au> <826027830snz@genesis.demon.co.uk>
- NNTP-Posting-Host: pbecker.borland.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=ISO-8859-1
- X-Newsreader: WinVN 0.99.5
-
- In article <826027830snz@genesis.demon.co.uk>, fred@genesis.demon.co.uk
- says...
- >
- >In article <c0d_9603050128@csource.blaze.net.au>
- > David.Burrows@f158.n633.z3.fidonet.org "David Burrows" writes:
- >
- >>Help.... I am getting floating point innaccuracies at about the 4th decimal
- >>
- >>place. eg i enter 510.0250 and it comes out as 510.0249.
- >>I am just starting to learn c so please excuse my ignorance.
- >
- >You don't give anyindication of what your code does or what (precise)
- >types of variable it uses so any answer to your question can only be a guess.
- >
- >That corresponds to an error in the 7th significant digit which is all you
- >can expect from float variables. If you want more precision you should
- >use double. Floating point errors are cumulative so if you are performing
- >a long calculation (such as in a loop) your results will become
- >progressively less precise.
-
- Picking nits here: the results will always be equally precise, but they will
- become progressively less accurate.
-
-